package cn.iocoder.yudao.module.biz.dal.mysql.customer.serviceUnit.team;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.biz.dal.dataobject.customer.serviceUnit.team.ServiceUnitTeamDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.biz.controller.admin.customer.serviceUnit.team.vo.*;

/**
 * 客户管理-服务单元-内部小组 Mapper
 *
 * @author 超级管理员
 */
@Mapper
public interface ServiceUnitTeamMapper extends BaseMapperX<ServiceUnitTeamDO> {

    default PageResult<ServiceUnitTeamDO> selectPage(ServiceUnitTeamPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<ServiceUnitTeamDO>()
                .likeIfPresent(ServiceUnitTeamDO::getName, reqVO.getName())
                .eqIfPresent(ServiceUnitTeamDO::getServiceUnitId, reqVO.getServiceUnitId())
                .likeIfPresent(ServiceUnitTeamDO::getServiceUnitName, reqVO.getServiceUnitName())
                .betweenIfPresent(ServiceUnitTeamDO::getCreateTime, reqVO.getCreateTime())
                .eqIfPresent(ServiceUnitTeamDO::getOwnerUserId, reqVO.getOwnerUserId())
                .orderByDesc(ServiceUnitTeamDO::getId));
    }

}